package top.shiyiri.community.dao;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import top.shiyiri.community.bean.User;

/**
 * @author Aunean
 * @date 2022/3/13 16:20
 */

@Repository
public interface UserMapper extends BaseMapper<User> {

    User selectById(@Param("id") int id);

    User selectByUserName(@Param("username") String username);

    User selectByEmail(@Param("email") String email);

    int insertUser(User user);

    int updateStatus(@Param("id") int id, @Param("status") int status);

    int updateHeader(@Param("id") int id, @Param("headerUrl") String headerUrl);

    int updatePassword(@Param("id") int id, @Param("password") String password);

    int deleteByPasswordAndStatus(@Param("password") String password, @Param("status") int status);
}
